package controller
{
	import common.HelloWorldConstants;
	
	import flash.utils.getQualifiedClassName;
	
	import org.osflash.thunderbolt.Logger;
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.utilities.fabrication.patterns.command.SimpleFabricationCommand;
	
	import view.HelloWorldApplicationBarMediator;
	import view.HelloWorldMediator;
	import view.ModuleTileMediator;

	public class HelloWorldStartupCommand extends SimpleFabricationCommand
	{
		public static const NAME:String = getQualifiedClassName(HelloWorldStartupCommand);
		
		override public function execute(notification:INotification):void
		{
			Logger.info(NAME+ " : execute()");
			var app:HelloWorld = notification.getBody() as HelloWorld;
			
			// proxy registrations
			//registerProxy(new ModuleListProxy());
				
			// command registrations
			registerCommand(HelloWorldConstants.LOAD_MODULE_COMMAND, LoadModuleCommand);

			// mediator registrations
			registerMediator(new HelloWorldMediator(app));
			registerMediator(new HelloWorldApplicationBarMediator(app.helloWorldApplicationBar));
			registerMediator(new ModuleTileMediator(app.moduleTile));		
			
			//start me up!
			sendNotification(HelloWorldConstants.SHOW_TIME, new Date());
		}
	}
}